package com.zjw.zy.coreui.fragment.adapter

import androidx.fragment.app.Fragment
import androidx.viewpager2.adapter.FragmentStateAdapter
import com.zjw.zy.coreui.fragment.tips.TipFragment.Companion.TIP_LIST_INDEX
import com.zjw.zy.coreui.fragment.tips.TipFragment.Companion.TIP_TOTAL_INDEX
import com.zjw.zy.coreui.fragment.tips.TipTotalFragment
import com.zjw.zy.coreui.fragment.tips.TipsListFragment

/**
 * @author ：zhong.jw
 * @date ：Created in 2022/11/2 14:41
 */
class TipSubViewAdapter(parent: Fragment) : FragmentStateAdapter(parent) {

    override fun getItemCount(): Int {
        return 2
    }

    override fun createFragment(position: Int): Fragment {
        when (position) {
            TIP_TOTAL_INDEX -> {
                return TipTotalFragment()
            }

            TIP_LIST_INDEX -> {
                return TipsListFragment()
            }
        }

        return TipTotalFragment()
    }

}